Line Prefix Switches

Search and Replace v 4.8+ has two special settings in Options|Output to customize the line prefix strings in the search results list and the output file when Display First Hit Line is enabled. The two switches are described below. These settings can also be specified in the [Options] section of a script.

Note: Earlier versions of the program required a registry switch or use of the special configuration utility on the Search & Replace home page to change these settings. With v 4.8 can be used to specify these switches in Options|Output.

Line Prefix

To make a new special setting, use a printf style format:

[Literal text]%[flags][width]d[Literal text]

where

Literal Text - This can precede or follow the number component.

% - This character is required.

flags - This can be space or 0. This determines padding character to use, if any if the width of the line number returned is less than width. Space padding to the left is assumed.

width - This is the minimum width to use. If you specify a number that is larger than the line number returned by Search and Replace, it is padded with space or 0, depending on above.

d - this is required. It must follow the width specification.

Line Prefix Examples:

Line %3d - This sample is actually the default form if nothing is specified. For example:
Line 81 - <http>://www.funduc.com
Line 82 - <http>://www.searchandr

%05d: This pads with 0, 5 wide, followed by : character. For example:
Line 00081: <http>://www.funduc.com
Line 00082: <http>://www.searchandr

Binary Line Prefix

This is similar to the Line Prefix setting above but controls the line prefix when the hit is in a binary file. The choices are similar to the Line Prefix setting above except you must specify should specify lx (lower case L, lower case X) for type. We suggest you preface the 0x for a literal but this is not required.

Binary Line Prefix Examples:

Offset 0x%6lx - This sample the default form if nothing is specified. For example:
Offset 0x155 - ⌠<H>
Offset 0x241 - <h>M

0x%05lx: This pads with 0, 5 wide, followed by : character. For example:
0x00155: ⌠<H>
0x00241: <h>M